#pragma once

extern BOOL g_isHook;
extern CRITICAL_SECTION g_csCreateWindow;
extern CRITICAL_SECTION g_csFlushFileBuffers;
extern CRITICAL_SECTION g_csCreateFile;
extern BOOL (WINAPI *TrueFlushFileBuffers)(
							 __in  HANDLE hFile
							 );

extern VOID (WINAPI *TrueExitProcess)(
									  __in  UINT uExitCode
									  );

extern HWND (WINAPI *TrueCreateWindowExW)(
				__in DWORD dwExStyle,
				__in_opt LPCWSTR lpClassName,
				__in_opt LPCWSTR lpWindowName,
				__in DWORD dwStyle,
				__in int X,
				__in int Y,
				__in int nWidth,
				__in int nHeight,
				__in_opt HWND hWndParent,
				__in_opt HMENU hMenu,
				__in_opt HINSTANCE hInstance,
				__in_opt LPVOID lpParam);


VOID __stdcall HookExitProcess(__in  UINT uExitCode);
HWND WINAPI HookCreateWindowExW(
								__in DWORD dwExStyle,
								__in_opt LPCWSTR lpClassName,
								__in_opt LPCWSTR lpWindowName,
								__in DWORD dwStyle,
								__in int X,
								__in int Y,
								__in int nWidth,
								__in int nHeight,
								__in_opt HWND hWndParent,
								__in_opt HMENU hMenu,
								__in_opt HINSTANCE hInstance,
								__in_opt LPVOID lpParam);

BOOL WINAPI HookFlushFileBuffers(__in  HANDLE hFile);

HANDLE WINAPI HookCreateFileW(
							  _In_      LPCWSTR lpFileName,
							  _In_      DWORD dwDesiredAccess,
							  _In_      DWORD dwShareMode,
							  _In_opt_  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
							  _In_      DWORD dwCreationDisposition,
							  _In_      DWORD dwFlagsAndAttributes,
							  _In_opt_  HANDLE hTemplateFile
								 );

extern HANDLE (WINAPI *TrueCreateFileW)(
										_In_      LPCWSTR lpFileName,
										_In_      DWORD dwDesiredAccess,
										_In_      DWORD dwShareMode,
										_In_opt_  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
										_In_      DWORD dwCreationDisposition,
										_In_      DWORD dwFlagsAndAttributes,
										_In_opt_  HANDLE hTemplateFile
										);